import service from '@/utils/axios'

export const GET_STAFF_LIST = (params: { name: string }) => {
  return service({
    url: '/staff/staffList',
    method: 'get',
    params
  })
}

export interface IStaff {
  name: string
  tel: string
  job: string
  jobNum: string
  password: string
  port: string
  id?: string
}
export const ADD_STAFF = (params: IStaff) => {
  return service({
    url: '/staff/staffAdd',
    method: 'post',
    data: params
  })
}
export const EDIT_STAFF = (params: IStaff) => {
  return service({
    url: '/staff/staffEdit',
    method: 'post',
    data: params
  })
}

/*
 *@description: 删除员工
 *@params:
 * id: 删除的员工Id
 *@author: 李少斌
 *@date: 2024-04-29 16:48:00
 */
export const DELETE_STAFF = (id: string) => {
  return service({
    url: '/staff/staffDel',
    method: 'get',
    params: {
      id
    }
  })
}
// 获取员工信息
export const GET_STAFF_INFO = (id: string) => {
  return service({
    url: '/staff/staffSearch',
    method: 'get',
    params: {
      id
    }
  })
}
